﻿Public Class a1details
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click

        Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("AudiConn").ConnectionString)

        Dim SqlString As String = "Insert into Ranges(ModelName,ModelYear,Color,Engine,Info) values (@f1,@f2,@f3,@f4,@f5)"

        Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand(SqlString, oleDbConn)
        cmd.CommandType = CommandType.Text
        cmd.Parameters.AddWithValue("@f1", tb_ModelName.Text)
        cmd.Parameters.AddWithValue("@f2", tb_ModelYear.Text)
        cmd.Parameters.AddWithValue("@f3", tb_Color.Text)
        cmd.Parameters.AddWithValue("@f4", tb_Engine.Text)
        cmd.Parameters.AddWithValue("@f5", tb_Info.Text)
        oleDbConn.Open()
        cmd.ExecuteNonQuery()
        Response.Redirect("confirmarion.aspx")

    End Sub
End Class